import csv
import pytest

def plus(num1, num2):
    return num1 + num2

# 读取测试数据
def ReadCSV():
    with open('D:/PythonWorkspace/python100/Day79/data.csv')as f:
        f_csv = csv.reader(f)
        next(f)
        list = []
        for row in f_csv:
            list.append(row)
    return list


@pytest.mark.parametrize("result", ReadCSV())
def test_plus(result):
    assert plus(int(result[0]), int(result[1])) == int(result[2])

if __name__ == '__main__':
    pytest.main(["-s", "huangcui.py", "--html=./report/result.html"])
